<template>
    <div class="physician-detail">
        <a-drawer
        :title="title"
        :maskClosable="true"
        width=650
        placement="right"
        :closable="true"
        @close="close"
        :visible="visible"
        style="overflow: auto;padding-bottom: 53px;">

        <h2 class="title">医务人员详情&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp


          <spen @click="back">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
            返回上一页</spen></h2>
        <div class="detail">
          <SubTitle title="基本信息"></SubTitle>
          <div class="content">
            <div class="row">
              <div class="label">医师姓名：</div>
              <div class="value">{{ infoData.name }}</div>
            </div>
            <div class="row">
              <div class="label">性别：</div>
              <div class="value">{{ infoData.sex }}</div>
            </div>
            <div class="row">
              <div class="label">出生日期：</div>
              <div class="value">{{ infoData.birthday }}</div>
            </div>
            <div class="row">
              <div class="label">身份证号：</div>
              <div class="value">{{ infoData.idCard }}</div>
            </div>
            <div class="row">
              <div class="label">执业证书编码：</div>
              <div class="value">{{ infoData.doctorLicence }}</div>
            </div>
            <div class="row">
              <div class="label">执业范围：</div>
              <div class="value">{{ infoData.parcticescope }}</div>
            </div>
            <div class="row">
              <div class="label">执业级别：</div>
              <div class="value">{{ infoData.parcticelevel }}</div>
            </div>
            <div class="row">
              <div class="label">多执业机构名称：</div>
              <div class="value">{{ infoData.unitname }}</div>
            </div>
            <div class="row">
              <div class="label">抗菌药物处方权：</div>
              <div class="value">{{ infoData.antibiosisAuthority }}</div>
            </div>



          </div>
        </div>
      </a-drawer>
    </div>
</template>
<script>
import SubTitle from '@/components/sub-title/index.vue'
import { listAll, getAll, delAll, addAll, updateAll, exportAll  } from "@/api/his/doctorAll";
export default {
    name: 'physicianDetail',
    components: {
        SubTitle
    },
    data() {
        return {
            title: "操作",
            visible: false,
            infoData: {

            }
        }
    },
  created() {
    console.log(this.$route.params.number)
    console.log("1111",this.$route.params.registerNumber)

    const number = this.$route.params.number;
    if (number) {
      this.getList(number);
    }
  },
    methods: {
      back() {
        if(this.$route.params.registerNumber){
          this.$router.push({ name: 'organizationDetail', params: { number: this.$route.params.registerNumber}});
        } else {
          this.$router.go(-1); // 返回上一页
        }
      },
      getList(row) {
        getAll(row).then(response => {
          console.log(response.data)
          this.infoData = response.data;
          let antibiosisAuthority = ''
          if(response.data.antibiosisAuthority ==0){
            antibiosisAuthority= '无抗菌药物处方权'
          }else if(response.data.antibiosisAuthority ==1){
            antibiosisAuthority= '非限制级'
          }else if(response.data.antibiosisAuthority ==2){
            antibiosisAuthority= '限制级'
          }else if(response.data.antibiosisAuthority ==3){
            antibiosisAuthority= '特殊级'
          }
          this.infoData.antibiosisAuthority = antibiosisAuthority;

        });
      },
        close() {
        this.$emit('close');
        this.visible = false;
        },
        add(scope) {
        this.visible = true;
        console.log("11111111",scope)
        }
    }
}
</script>
<style scoped lang="scss">
.physician-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: default;

    .title {
        margin-top: 10px;
        font-weight: bold;
        font-size: 26px;
        line-height: 26px;
        color: #4B4B4B;
    }
    .content {
        margin-top: 26px;
        padding-left: 16px;
        flex: 1;

        .row {
            margin-top: 26px;
            display: flex;

            &:nth-child(1) {
                margin-top: 0;
            }

            .label {
                color: #8B8B8B;
                font-size: 16px;
                font-weight: 500;
                width: 117px;
                margin-right: 29px;
            }

            .value {
                font-weight: 500;
                font-size: 16px;
                color: #4B4B4B;
            }
        }
    }
}
.card {
    background-color: #fff;
    padding: 19px 13px 19px;
    margin-top: 14px;
}
.flex-1 {
    flex: 1;
}
.table {
    flex: 1;
    background-color: #fff;
    margin: 13px 0 16px;

    ::v-deep .table-header-cell {
        background-color: #EBEFF8;
        padding-left: 21px;
        font-weight: 500;
        font-size: 16px;
        color: #414141;
    }
    .el-table {
        height: 100%;
    }
    ::v-deep .el-table__cell {
        padding-left: 21px;
        font-weight: 500;
        font-size: 16px;
        color: #414141;
    }
    :v-deep .el-table__body-wrapper {
        height: 100%;
    }
    :v-deep .el-table__empty-block {
        height: 100%;
    }

}
.operation {
    display: flex;
    align-items: center;
    height: 100%;

    .view {
        cursor: pointer;
        font-weight: 500;
        font-size: 16px;
        color: #4373F1;
        height: 16px;
        line-height: 16px;
        background-repeat: no-repeat;
        background-position: 0 center;
        user-select: none;
        padding-left: 20px;
    }
    .view {
            background-image: url('~@/assets/images/table/view.png');
    }
}
</style>
